<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
     <style>
     
      div{
          width: 100px;
          height: 100px;
          background-color: hotpink;
          position:absolute;
      }

     </style>
</head>
<body>
    
      <button>开始</button>
      <button>暂停</button>
  
        <div style='left:100px;top:100px'></div>

</body>
</html>
<script>
  
  let divObj = document.getElementsByTagName('div')[0];
  let btnList = document.querySelectorAll('button');

  //开始
  btnList[0].onclick=()=>{

     //获得div元素的left的值
     let left_x = divObj.style.left;
     console.log(left_x);

  }
    //暂停
    btnList[1].onclick=()=>{
      
    }


</script>